package com.example.multidatasource.config;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@ConditionalOnProperty(name = "spring.enable.multi.datasource",havingValue = "true")
@ConfigurationProperties(prefix = "spring.multi")
@Configuration
@Getter
@Setter
@Slf4j
public class MultiDataSource {
    public MultiDataSource() {
        log.info("开始配置多数据源");
    }

    private List<DruidDataSourceProperties> datasource;
}
